/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
// Forked Cosmo 3.3.7
// Bootswatch
// -----------------------------------------------------

// Navbar =====================================================================

.navbar {
  border: none;

  li > a:focus {
    outline: 0;
  }

  &-inverse {

    .badge {
      background-color: #fff;
      color: @brand-primary;
    }
  }

  b.caret {
    display: inline-block;
    padding: 0 5px 18px 5px;
  }
}

.navbar-inverse {
  border: 3px solid @navbar-inverse-bg;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus,
.navbar-inverse .navbar-nav > li.active > a {
  background: transparent;
  border-bottom: 3px solid @brand-primary;
  margin-bottom: -3px;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
  background: transparent;
}

.navbar-nav > li > a {
  padding-top: 18px;
}

// Buttons ====================================================================

.btn-default:hover {
  color: #555;
  background-color: #efefef;
}

.nav-tabs {
  .dropdown-toggle.btn,
  .dropdown-toggle.btn:hover,
  .dropdown-toggle.btn:active,
  .dropdown-toggle.btn:focus,
  .btn-group.open .dropdown-toggle.btn,
  .btn-group.open .dropdown-toggle.btn:hover,
  .btn-group.open .dropdown-toggle.btn:active,
  .btn-group.open .dropdown-toggle.btn:focus {
    border-color: transparent;
    background-color: transparent;
    box-shadow: none;
  }
}

.caret {
  border: none;
  color: @gray;
}

.caret:before {
  font-family: "FontAwesome";
  font-size: 10px;
  content: "\f078";
}

.caret:hover {
  color: @gray-darker;
}

// Typography =================================================================

body {
  -webkit-font-smoothing: antialiased;
}

.text-primary,
.text-primary:hover {
  color: @brand-primary;
}

.text-success,
.text-success:hover {
  color: @brand-success;
}

.text-danger,
.text-danger:hover {
  color: @brand-danger;
}

.text-warning,
.text-warning:hover {
  color: @brand-warning;
}

.text-info,
.text-info:hover {
  color: @brand-info;
}

// Tables =====================================================================

table,
.table {

  .dropdown-menu a {
    text-decoration: none;
  }

  .success,
  .warning,
  .danger,
  .info {
    color: #fff;

    a {
      color: #fff;
    }

    .btn-default {
      color: @gray;
    }
  }
}

// Forms ======================================================================


.has-warning {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-warning;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-warning;
  }
}

.has-error {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-danger;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-danger;
  }
}

.has-success {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-success;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-success;
  }
}

// Navs =======================================================================

.nav-pills {

  & > li > a {
    border-radius: 2px;
  }
}

.dropdown-menu {

  & > li > a:hover,
  & > li > a:focus {
    background-image: none;
  }
}

// Indicators =================================================================

.close {
  text-decoration: none;
  text-shadow: none;
  opacity: 0.4;

  &:hover,
  &:focus {
    opacity: 1;
  }
}

.alert {
  border: none;
}
.alert-link {
  text-decoration: underline;
}

.alert-info .alert-link {
  color: @alert-info-text;
}
.alert-danger .alert-link {
  color: @alert-danger-text;
}
.alert-warning .alert-link {
  color: @alert-warning-text;
}
.alert-success .alert-link {
  color: @alert-success-text;
}

.label {
  border-radius: 2px;
}
label {
  font-weight: normal;
}

// Progress bars ==============================================================

.progress {
  height: 14px;
  .box-shadow(none);
  .progress-bar {
    font-size: 12px;
    line-height: 12px;
    padding-top: 1px;
  }
}

// Containers =================================================================

.panel {
  border: none;
  &-heading,
  &-footer {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
  }

  &-default {
    .panel-heading {
      padding: 15px 15px 0 15px;
      background-color: transparent;
    }
    .panel-title {
      color: @text-color;
      padding-bottom: 5px;
      border-bottom: 1px solid @gray-light;
      h1, h2, h3, h4, h5, h6 {
        margin: 10px 0 0 0;
        font-weight: bold;
      }
    }
    .close {
      color: @text-color;
    }
  }
  &-primary{
    .panel-heading {
      padding: 15px 15px 0 15px;
      background-color: transparent;
    }
    .panel-title {
      color: @text-color;
      padding-bottom: 5px;
      border-bottom: 1px solid @gray-light;
      h1, h2, h3, h4, h5, h6 {
        margin: 10px 0 0 0;
        font-weight: bold;
      }
    }
    .close {
      color: @text-color;
    }
  }
}

.panel-title-large {
  font-size: 24px;
}

a.list-group-item {

  &-success {
    &.active {
      background-color: @state-success-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-success-bg, 5%);
    }
  }

  &-warning {
    &.active {
      background-color: @state-warning-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-warning-bg, 5%);
    }
  }

  &-danger {
    &.active {
      background-color: @state-danger-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-danger-bg, 5%);
    }
  }
}

.modal {
  .close {
    color: @text-color;
  }
}

.popover {
  color: @text-color;
}

// Tabs ==============================================================

.nav-tabs > li > a {
  border-top: 3px solid transparent;
}

.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
  background-color: #fff;
  font-weight: bold;
  border-top: 3px solid @brand-primary;
}

// Tables ==============================================================

.table {
  .info {
    color: @state-info-text;
  }
  .danger {
    color: @state-danger-text;
  }
  .warning {
    color: @state-warning-text;
  }
  .success {
    color: @state-success-text;
  }
}

// Utils ==============================================================
hr {
  margin: 10px 0;
}

// generate space-n classes for vertical spacing
.space-loop(@counter) when (@counter > 0) {
  .space-loop((@counter - 1));    // next iteration
  .space-@{counter} {
    margin-bottom: (10px * @counter); // code for each iteration
  }
}
.space-loop(6);

a {
  cursor: pointer;
}

